<?php

namespace app\common\model;

use think\Db;
use think\Model;

/**
 * 修复配件
 */
class PartsArt extends Model
{

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 追加属性
    protected $append = [

    ];

    //任务相关的工艺列表
    public static function getTaskPartLists($task_id)
    {
        $part_ids = TaskItem::where('task_id', $task_id)->column('part_id');
        return self::whereIn('part_id',$part_ids)->order('createtime desc')->select();
    }

}
